package com.ds.dsm.view.config.grid.field;

import com.ds.dsm.view.config.grid.cell.GridCellService;
import com.ds.esd.custom.annotation.CustomAnnotation;
import com.ds.esd.custom.annotation.toolbar.BottomBarMenu;
import com.ds.esd.custom.form.annotation.FormAnnotation;
import com.ds.esd.custom.form.enums.CustomFormMenu;
import com.ds.esd.dsm.view.field.FieldGridConfig;
import com.ds.esd.tool.ui.enums.ComboInputType;
import com.ds.web.annotation.Pid;
import com.ds.web.annotation.Required;

@BottomBarMenu
@FormAnnotation(col = 2, bottombarMenu = {CustomFormMenu.Save, CustomFormMenu.ReSet}, customService = GridCellService.class)
public class FieldGridConfigView {

    @Pid
    String viewInstId;

    @Pid
    String domainId;
    @Pid
    String methodName;

    @Pid
    String entityClassName;

    @Pid
    String sourceClassName;

    @CustomAnnotation(caption = "字段名", uid = true)
    String fieldname;

    @CustomAnnotation(caption = "显示名称", readonly = true)
    String caption;
    @Required
    @CustomAnnotation(caption = "数据类型")
    ComboInputType inputType;
    @CustomAnnotation(caption = "列宽")
    String width;
    @CustomAnnotation(caption = "是否主键")
    Boolean uid;
    @CustomAnnotation(caption = "是否锁定")
    Boolean lock;

    @CustomAnnotation(caption = "隐藏标签")
    Boolean haslable;

    @CustomAnnotation(caption = "隐藏")
    Boolean colHidden;


    public FieldGridConfigView() {

    }

    public FieldGridConfigView(FieldGridConfig config) {
        this.width = config.getGridColItemBean().getWidth();
        this.haslable = config.getHaslable();
        this.sourceClassName = config.getSourceClassName();
        this.entityClassName = config.getEntityClassName();
        this.viewInstId = config.getDomainId();
        this.domainId = config.getDomainId();
        this.inputType = config.getGridColItemBean().getInputType();
        this.lock = config.getGridColItemBean().getLock();
        this.caption = config.getCaption();
        this.fieldname = config.getFieldname();
        this.colHidden = config.getColHidden();
        this.uid = config.getUid();
        this.methodName = config.getSourceMethodName();


    }

    public String getDomainId() {
        return domainId;
    }

    public void setDomainId(String domainId) {
        this.domainId = domainId;
    }

    public String getWidth() {
        return width;
    }

    public void setWidth(String width) {
        this.width = width;
    }

    public Boolean getLock() {
        return lock;
    }

    public void setLock(Boolean lock) {
        this.lock = lock;
    }

    public Boolean getHaslable() {
        return haslable;
    }

    public void setHaslable(Boolean haslable) {
        this.haslable = haslable;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getEntityClassName() {
        return entityClassName;
    }

    public void setEntityClassName(String entityClassName) {
        this.entityClassName = entityClassName;
    }

    public String getSourceClassName() {
        return sourceClassName;
    }

    public void setSourceClassName(String sourceClassName) {
        this.sourceClassName = sourceClassName;
    }

    public String getViewInstId() {
        return viewInstId;
    }

    public void setViewInstId(String viewInstId) {
        this.viewInstId = viewInstId;
    }

    public String getFieldname() {
        return fieldname;
    }

    public void setFieldname(String fieldname) {
        this.fieldname = fieldname;
    }

    public Boolean getUid() {
        return uid;
    }

    public void setUid(Boolean uid) {
        this.uid = uid;
    }

    public String getCaption() {
        return caption;
    }

    public void setCaption(String caption) {
        this.caption = caption;
    }

    public ComboInputType getInputType() {
        return inputType;
    }

    public void setInputType(ComboInputType inputType) {
        this.inputType = inputType;
    }

    public Boolean getColHidden() {
        return colHidden;
    }

    public void setColHidden(Boolean colHidden) {
        this.colHidden = colHidden;
    }
}
